"""
管理员管理视图
"""
from django.contrib.auth.models import Group
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from users.models import User
from meiduo_admin.serializers.admin_serializers import *
from meiduo_admin.paginations import MyPage


class AdminView(ModelViewSet):
    """
    管理员管理
    """
    queryset = User.objects.filter(is_staff=True)
    serializer_class = AdminSerializer
    pagination_class = MyPage

class GroupListView(ListAPIView):
    """
    新增时可选的用户组
    """
    queryset = Group.objects.all()
    serializer_class = GroupSimpleSerializer
    